home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1998 January: Mac OS SDK / Dev.CD Jan 98 SDK1.toast / Development Kits (Disc 1) / Interfaces&Libraries / Universal / Interfaces / PInterfaces / Controls.p < prev    next >
Encoding:
Text File  |  1997-08-12  |  23.4 KB  |  716 lines  |  [TEXT/MPS ]

  1. {
  2.      File:        Controls.p
  3.  
  4.      Contains:    Control Manager interfaces
  5.  
  6.      Version:    Technology:    MacOS 7.x
  7.                  Release:    Universal Interfaces 3.0.1
  8.  
  9.      Copyright:    © 1985-1997 by Apple Computer, Inc., all rights reserved
  10.  
  11.      Bugs?:        Please include the the file and version information (from above) with
  12.                  the problem description.  Developers belonging to one of the Apple
  13.                  developer programs can submit bug reports to:
  14.  
  15.                      devsupport@apple.com
  16.  
  17. }
  18. {$IFC UNDEFINED UsingIncludes}
  19. {$SETC UsingIncludes := 0}
  20. {$ENDC}
  21.  
  22. {$IFC NOT UsingIncludes}
  23.  UNIT Controls;
  24.  INTERFACE
  25. {$ENDC}
  26.  
  27. {$IFC UNDEFINED __CONTROLS__}
  28. {$SETC __CONTROLS__ := 1}
  29.  
  30. {$I+}
  31. {$SETC ControlsIncludes := UsingIncludes}
  32. {$SETC UsingIncludes := 1}
  33.  
  34. {$IFC UNDEFINED __TYPES__}
  35. {$I Types.p}
  36. {$ENDC}
  37. {$IFC UNDEFINED __QUICKDRAW__}
  38. {$I Quickdraw.p}
  39. {$ENDC}
  40. {$IFC UNDEFINED __MENUS__}
  41. {$I Menus.p}
  42. {$ENDC}
  43.  
  44.  
  45. {$PUSH}
  46. {$ALIGN MAC68K}
  47. {$LibExport+}
  48.  
  49. {
  50.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  51.       • Resource types
  52.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  53. }
  54.  
  55. CONST
  56.     kControlDefProcType            = 'CDEF';
  57.     kControlTemplateResourceType = 'CNTL';
  58.     kControlColorTableResourceType = 'cctb';
  59.     kControlDefProcResourceType    = 'CDEF';
  60.  
  61. {
  62.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  63.       • Format of a 'CNTL' resource
  64.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  65. }
  66.  
  67.  
  68. TYPE
  69.     ControlTemplatePtr = ^ControlTemplate;
  70.     ControlTemplate = RECORD
  71.         controlRect:            Rect;
  72.         controlValue:            SInt16;
  73.         controlVisible:            BOOLEAN;
  74.         fill:                    SInt8;
  75.         controlMaximum:            SInt16;
  76.         controlMinimum:            SInt16;
  77.         controlDefProcID:        SInt16;
  78.         controlReference:        SInt32;
  79.         controlTitle:            Str255;
  80.     END;
  81.  
  82.     ControlTemplateHandle                = ^ControlTemplatePtr;
  83. {
  84.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  85.    • CONTROL DEFINITION ID'S
  86.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  87. }
  88.  
  89. {  Standard System 7 procID's }
  90.  
  91.  
  92. CONST
  93.     pushButProc                    = 0;
  94.     checkBoxProc                = 1;
  95.     radioButProc                = 2;
  96.     scrollBarProc                = 16;
  97.     popupMenuProc                = 1008;
  98.  
  99. {
  100.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  101.    • VARIANT CODES
  102.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  103. }
  104.  
  105. TYPE
  106.     ControlVariant                        = SInt16;
  107.  
  108. CONST
  109.     kControlNoVariant            = 0;                            {  No variant }
  110.     kControlUsesOwningWindowsFontVariant = $08;                    {  Control uses owning windows font to display text }
  111.  
  112. {
  113.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  114.    • CONTROL PART CODES
  115.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  116. }
  117.  
  118. TYPE
  119.     ControlPartCode                        = SInt16;
  120.  
  121. CONST
  122.     kControlNoPart                = 0;
  123.     kControlLabelPart            = 1;
  124.     kControlMenuPart            = 2;
  125.     kControlTrianglePart        = 4;
  126.     kControlButtonPart            = 10;
  127.     kControlCheckBoxPart        = 11;
  128.     kControlRadioButtonPart        = 11;
  129.     kControlUpButtonPart        = 20;
  130.     kControlDownButtonPart        = 21;
  131.     kControlPageUpPart            = 22;
  132.     kControlPageDownPart        = 23;
  133.     kControlIndicatorPart        = 129;
  134.     kControlDisabledPart        = 254;
  135.     kControlInactivePart        = 255;
  136.  
  137. {
  138.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  139.    • CHECK BOX VALUES
  140.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  141. }
  142.  
  143.     kControlCheckBoxUncheckedValue = 0;
  144.     kControlCheckBoxCheckedValue = 1;
  145.     kControlCheckBoxMixedValue    = 2;
  146.  
  147. {
  148.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  149.    • RADIO BUTTON VALUES
  150.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  151. }
  152.  
  153.     kControlRadioButtonUncheckedValue = 0;
  154.     kControlRadioButtonCheckedValue = 1;
  155.     kControlRadioButtonMixedValue = 2;
  156.  
  157. {
  158.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  159.    
  160.    • CONTROL POP-UP MENU CONSTANTS
  161.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  162. }
  163.  
  164. {  Variant codes for the System 7 pop-up menu }
  165.     popupFixedWidth                = $01;
  166.     popupVariableWidth            = $02;
  167.     popupUseAddResMenu            = $04;
  168.     popupUseWFont                = $08;
  169.  
  170. {  Menu label styles for the System 7 pop-up menu  }
  171.     popupTitleBold                = $0100;
  172.     popupTitleItalic            = $0200;
  173.     popupTitleUnderline            = $0400;
  174.     popupTitleOutline            = $0800;
  175.     popupTitleShadow            = $1000;
  176.     popupTitleCondense            = $2000;
  177.     popupTitleExtend            = $4000;
  178.     popupTitleNoStyle            = $8000;
  179.  
  180. {  Menu label justifications for the System 7 pop-up menu }
  181.     popupTitleLeftJust            = $00000000;
  182.     popupTitleCenterJust        = $00000001;
  183.     popupTitleRightJust            = $000000FF;
  184.  
  185. {
  186.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  187.    • CONTROL DRAGGRAYRGN CONSTANTS
  188.      For DragGrayRgnUPP used in TrackControl() 
  189.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  190. }
  191.  
  192.     noConstraint                = 0;
  193.     hAxisOnly                    = 1;
  194.     vAxisOnly                    = 2;
  195.  
  196. {
  197.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  198.    • CONTROL COLOR TABLE PART CODES
  199.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  200. }
  201.  
  202.     cFrameColor                    = 0;
  203.     cBodyColor                    = 1;
  204.     cTextColor                    = 2;
  205.     cThumbColor                    = 3;
  206.     kNumberCtlCTabEntries        = 4;
  207.  
  208. {
  209.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  210.    • CONTROLHANDLE
  211.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  212. }
  213.  
  214.  
  215. TYPE
  216.     ControlRecordPtr = ^ControlRecord;
  217.     ControlPtr                            = ^ControlRecord;
  218.     ControlHandle                        = ^ControlPtr;
  219. {  ControlRef is obsolete. Use ControlHandle.  }
  220.     ControlRef                            = ControlHandle;
  221. {
  222.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  223.    • CONTROL ACTIONPROC POINTER
  224.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  225. }
  226.     ControlActionProcPtr = ProcPtr;  { PROCEDURE ControlAction(theControl: ControlHandle; partCode: ControlPartCode); }
  227.  
  228.     ControlActionUPP = UniversalProcPtr;
  229. {
  230.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  231.    • CONTROL COLOR TABLE
  232.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  233. }
  234.     CtlCTabPtr = ^CtlCTab;
  235.     CtlCTab = RECORD
  236.         ccSeed:                    SInt32;
  237.         ccRider:                SInt16;
  238.         ctSize:                    SInt16;
  239.         ctTable:                ARRAY [0..3] OF ColorSpec;
  240.     END;
  241.  
  242.     CCTabPtr                            = ^CtlCTab;
  243.     CCTabHandle                            = ^CCTabPtr;
  244. {
  245.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  246.    • CONTROL RECORD
  247.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  248. }
  249.     ControlRecord = PACKED RECORD
  250.         nextControl:            ControlHandle;
  251.         contrlOwner:            WindowPtr;
  252.         contrlRect:                Rect;
  253.         contrlVis:                UInt8;
  254.         contrlHilite:            UInt8;
  255.         contrlValue:            SInt16;
  256.         contrlMin:                SInt16;
  257.         contrlMax:                SInt16;
  258.         contrlDefProc:            Handle;
  259.         contrlData:                Handle;
  260.         contrlAction:            ControlActionUPP;
  261.         contrlRfCon:            SInt32;
  262.         contrlTitle:            Str255;
  263.     END;
  264.  
  265. {
  266.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  267.    • AUXILLARY CONTROL RECORD STRUCTURE
  268.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  269. }
  270.     AuxCtlRecPtr = ^AuxCtlRec;
  271.     AuxCtlRec = RECORD
  272.         acNext:                    Handle;
  273.         acOwner:                ControlHandle;
  274.         acCTable:                CCTabHandle;
  275.         acFlags:                SInt16;
  276.         acReserved:                SInt32;
  277.         acRefCon:                SInt32;
  278.     END;
  279.  
  280.     AuxCtlPtr                            = ^AuxCtlRec;
  281.     AuxCtlHandle                        = ^AuxCtlPtr;
  282. {
  283.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  284.    • POP-UP MENU PRIVATE DATA STRUCTURE
  285.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  286. }
  287.     PopupPrivateDataPtr = ^PopupPrivateData;
  288.     PopupPrivateData = RECORD
  289.         mHandle:                MenuHandle;
  290.         mID:                    SInt16;
  291.     END;
  292.  
  293.     PopupPrivateDataHandle                = ^PopupPrivateDataPtr;
  294. {
  295.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  296.    • CONTROL ACTION PROC UPP'S
  297.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  298. }
  299.  
  300.  
  301.  
  302. CONST
  303.     uppControlActionProcInfo = $000002C0;
  304.  
  305. FUNCTION NewControlActionProc(userRoutine: ControlActionProcPtr): ControlActionUPP;
  306.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  307.     INLINE $2E9F;
  308.     {$ENDC}
  309.  
  310. PROCEDURE CallControlActionProc(theControl: ControlHandle; partCode: ControlPartCode; userRoutine: ControlActionUPP);
  311.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  312.     INLINE $205F, $4E90;
  313.     {$ENDC}
  314. {
  315.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  316.       
  317.    • CONTROL CREATION / DELETION API'S
  318.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  319. }
  320. FUNCTION NewControl(owningWindow: WindowPtr; {CONST}VAR boundsRect: Rect; controlTitle: ConstStr255Param; initiallyVisible: BOOLEAN; initialValue: SInt16; minimumValue: SInt16; maximumValue: SInt16; procID: SInt16; controlReference: SInt32): ControlHandle;
  321.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  322.     INLINE $A954;
  323.     {$ENDC}
  324. FUNCTION GetNewControl(resourceID: SInt16; owningWindow: WindowPtr): ControlHandle;
  325.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  326.     INLINE $A9BE;
  327.     {$ENDC}
  328. PROCEDURE DisposeControl(theControl: ControlHandle);
  329.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  330.     INLINE $A955;
  331.     {$ENDC}
  332. PROCEDURE KillControls(theWindow: WindowPtr);
  333.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  334.     INLINE $A956;
  335.     {$ENDC}
  336. {
  337.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  338.       
  339.    • CONTROL SHOWING/HIDING API'S
  340.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  341. }
  342.  
  343. PROCEDURE ShowControl(theControl: ControlHandle);
  344.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  345.     INLINE $A957;
  346.     {$ENDC}
  347. PROCEDURE HideControl(theControl: ControlHandle);
  348.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  349.     INLINE $A958;
  350.     {$ENDC}
  351. {
  352.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  353.       
  354.    • CONTROL DRAWING API'S
  355.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  356. }
  357.  
  358. PROCEDURE DrawControls(theWindow: WindowPtr);
  359.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  360.     INLINE $A969;
  361.     {$ENDC}
  362. PROCEDURE Draw1Control(theControl: ControlHandle);
  363.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  364.     INLINE $A96D;
  365.     {$ENDC}
  366.  
  367. PROCEDURE UpdateControls(theWindow: WindowPtr; updateRegion: RgnHandle);
  368.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  369.     INLINE $A953;
  370.     {$ENDC}
  371. {
  372.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  373.       
  374.    • CONTROL HIGHLIGHT API'S
  375.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  376. }
  377.  
  378. PROCEDURE HiliteControl(theControl: ControlHandle; hiliteState: ControlPartCode);
  379.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  380.     INLINE $A95D;
  381.     {$ENDC}
  382. {
  383.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  384.       
  385.    • CONTROL TRACKING/DRAGGING API'S
  386.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  387. }
  388.  
  389. {
  390.       When using the TrackControl() call when tracking an indicator, the actionProc parameter (type ControlActionUPP) 
  391.     should be replaced by a parameter of type DragGrayRgnUPP (see Quickdraw.h).
  392. }
  393. FUNCTION TrackControl(theControl: ControlHandle; startPoint: Point; actionProc: ControlActionUPP): ControlPartCode;
  394.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  395.     INLINE $A968;
  396.     {$ENDC}
  397. PROCEDURE DragControl(theControl: ControlHandle; startPoint: Point; {CONST}VAR limitRect: Rect; {CONST}VAR slopRect: Rect; axis: DragConstraint);
  398.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  399.     INLINE $A967;
  400.     {$ENDC}
  401. FUNCTION TestControl(theControl: ControlHandle; testPoint: Point): ControlPartCode;
  402.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  403.     INLINE $A966;
  404.     {$ENDC}
  405. FUNCTION FindControl(testPoint: Point; theWindow: WindowPtr; VAR theControl: ControlHandle): ControlPartCode;
  406.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  407.     INLINE $A96C;
  408.     {$ENDC}
  409. {
  410.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  411.       
  412.    • CONTROL MOVING/SIZING API'S
  413.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  414. }
  415.  
  416. PROCEDURE MoveControl(theControl: ControlHandle; h: SInt16; v: SInt16);
  417.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  418.     INLINE $A959;
  419.     {$ENDC}
  420. PROCEDURE SizeControl(theControl: ControlHandle; w: SInt16; h: SInt16);
  421.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  422.     INLINE $A95C;
  423.     {$ENDC}
  424. {
  425.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  426.       
  427.    • CONTROL TITLE API'S
  428.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  429. }
  430.  
  431. PROCEDURE SetControlTitle(theControl: ControlHandle; title: ConstStr255Param);
  432.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  433.     INLINE $A95F;
  434.     {$ENDC}
  435. PROCEDURE GetControlTitle(theControl: ControlHandle; VAR title: Str255);
  436.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  437.     INLINE $A95E;
  438.     {$ENDC}
  439. {
  440.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  441.       
  442.    • CONTROL VALUE, MIMIMUM, AND MAXIMUM API'S
  443.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  444. }
  445.  
  446. FUNCTION GetControlValue(theControl: ControlHandle): SInt16;
  447.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  448.     INLINE $A960;
  449.     {$ENDC}
  450. PROCEDURE SetControlValue(theControl: ControlHandle; newValue: SInt16);
  451.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  452.     INLINE $A963;
  453.     {$ENDC}
  454. FUNCTION GetControlMinimum(theControl: ControlHandle): SInt16;
  455.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  456.     INLINE $A961;
  457.     {$ENDC}
  458. PROCEDURE SetControlMinimum(theControl: ControlHandle; newMinimum: SInt16);
  459.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  460.     INLINE $A964;
  461.     {$ENDC}
  462. FUNCTION GetControlMaximum(theControl: ControlHandle): SInt16;
  463.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  464.     INLINE $A962;
  465.     {$ENDC}
  466. PROCEDURE SetControlMaximum(theControl: ControlHandle; newMaximum: SInt16);
  467.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  468.     INLINE $A965;
  469.     {$ENDC}
  470. {
  471.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  472.       
  473.    • CONTROL VARIANT AND WINDOW INFORMATION API'S
  474.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  475. }
  476.  
  477. FUNCTION GetControlVariant(theControl: ControlHandle): ControlVariant;
  478.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  479.     INLINE $A809;
  480.     {$ENDC}
  481. {
  482.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  483.       
  484.    • CONTROL ACTION PROC API'S
  485.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  486. }
  487.  
  488. PROCEDURE SetControlAction(theControl: ControlHandle; actionProc: ControlActionUPP);
  489.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  490.     INLINE $A96B;
  491.     {$ENDC}
  492. FUNCTION GetControlAction(theControl: ControlHandle): ControlActionUPP;
  493.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  494.     INLINE $A96A;
  495.     {$ENDC}
  496. {
  497.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  498.       
  499.    • CONTROL ACCESSOR API'S
  500.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  501. }
  502.  
  503. PROCEDURE SetControlReference(theControl: ControlHandle; data: SInt32);
  504.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  505.     INLINE $A95B;
  506.     {$ENDC}
  507. FUNCTION GetControlReference(theControl: ControlHandle): SInt32;
  508.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  509.     INLINE $A95A;
  510.     {$ENDC}
  511. FUNCTION GetAuxiliaryControlRecord(theControl: ControlHandle; VAR acHndl: AuxCtlHandle): BOOLEAN;
  512.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  513.     INLINE $AA44;
  514.     {$ENDC}
  515. PROCEDURE SetControlColor(theControl: ControlHandle; newColorTable: CCTabHandle);
  516.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  517.     INLINE $AA43;
  518.     {$ENDC}
  519. {
  520.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  521.       
  522.    • VALID 'CDEF' MESSAGES
  523.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  524. }
  525.  
  526.  
  527. TYPE
  528.     ControlDefProcMessage                = SInt16;
  529.  
  530. CONST
  531.     drawCntl                    = 0;
  532.     testCntl                    = 1;
  533.     calcCRgns                    = 2;
  534.     initCntl                    = 3;
  535.     dispCntl                    = 4;
  536.     posCntl                        = 5;
  537.     thumbCntl                    = 6;
  538.     dragCntl                    = 7;
  539.     autoTrack                    = 8;
  540.     calcCntlRgn                    = 10;
  541.     calcThumbRgn                = 11;
  542.     drawThumbOutline            = 12;
  543.  
  544. {
  545.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  546.       
  547.    • MAIN ENTRY POINT FOR 'CDEF'
  548.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  549. }
  550.  
  551.  
  552. TYPE
  553.     ControlDefProcPtr = ProcPtr;  { FUNCTION ControlDef(varCode: SInt16; theControl: ControlHandle; message: ControlDefProcMessage; param: SInt32): SInt32; }
  554.  
  555.     ControlDefUPP = UniversalProcPtr;
  556.  
  557. CONST
  558.     uppControlDefProcInfo = $00003BB0;
  559.  
  560. FUNCTION NewControlDefProc(userRoutine: ControlDefProcPtr): ControlDefUPP;
  561.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  562.     INLINE $2E9F;
  563.     {$ENDC}
  564.  
  565. FUNCTION CallControlDefProc(varCode: SInt16; theControl: ControlHandle; message: ControlDefProcMessage; param: SInt32; userRoutine: ControlDefUPP): SInt32;
  566.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  567.     INLINE $205F, $4E90;
  568.     {$ENDC}
  569. {
  570.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  571.       
  572.    • CONSTANTS FOR DRAWCNTL MESSAGE PASSED IN PARAM
  573.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  574. }
  575.  
  576. CONST
  577.     kDrawControlEntireControl    = 0;
  578.     kDrawControlIndicatorOnly    = 129;
  579.  
  580. {
  581.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  582.       
  583.    • CONSTANTS FOR DRAGCNTL MESSAGE PASSED IN PARAM
  584.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  585. }
  586.  
  587.     kDragControlEntireControl    = 0;
  588.     kDragControlIndicator        = 1;
  589.  
  590. {
  591.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  592.       
  593.    • DRAG CONSTRAINT STRUCTURE PASSED IN PARAM FOR THUMBCNTL MESSAGE (IM I-332)
  594.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  595. }
  596.  
  597.  
  598. TYPE
  599.     IndicatorDragConstraintPtr = ^IndicatorDragConstraint;
  600.     IndicatorDragConstraint = RECORD
  601.         limitRect:                Rect;
  602.         slopRect:                Rect;
  603.         axis:                    DragConstraint;
  604.     END;
  605.  
  606.     IndicatorDragConstraintHandle        = ^IndicatorDragConstraintPtr;
  607. {$IFC OLDROUTINENAMES }
  608. {
  609.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  610.    • OLDROUTINENAMES
  611.   —————————————————————————————————————————————————————————————————————————————————————————————————————————
  612. }
  613. {  Variants applicable to all controls (at least ones with text) }
  614.  
  615. CONST
  616.     useWFont                    = $08;
  617.  
  618.     inLabel                        = 1;
  619.     inMenu                        = 2;
  620.     inTriangle                    = 4;
  621.     inButton                    = 10;
  622.     inCheckBox                    = 11;
  623.     inUpButton                    = 20;
  624.     inDownButton                = 21;
  625.     inPageUp                    = 22;
  626.     inPageDown                    = 23;
  627.     inThumb                        = 129;
  628.  
  629.     kNoHiliteControlPart        = 0;
  630.     kInLabelControlPart            = 1;
  631.     kInMenuControlPart            = 2;
  632.     kInTriangleControlPart        = 4;
  633.     kInButtonControlPart        = 10;
  634.     kInCheckBoxControlPart        = 11;
  635.     kInUpButtonControlPart        = 20;
  636.     kInDownButtonControlPart    = 21;
  637.     kInPageUpControlPart        = 22;
  638.     kInPageDownControlPart        = 23;
  639.     kInIndicatorControlPart        = 129;
  640.     kReservedControlPart        = 254;
  641.     kControlInactiveControlPart    = 255;
  642.  
  643. PROCEDURE SetCTitle(theControl: ControlHandle; title: Str255);
  644.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  645.     INLINE $A95F;
  646.     {$ENDC}
  647. PROCEDURE GetCTitle(theControl: ControlHandle; VAR title: Str255);
  648.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  649.     INLINE $A95E;
  650.     {$ENDC}
  651. PROCEDURE UpdtControl(theWindow: WindowPtr; updateRgn: RgnHandle);
  652.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  653.     INLINE $A953;
  654.     {$ENDC}
  655. PROCEDURE SetCtlValue(theControl: ControlHandle; theValue: INTEGER);
  656.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  657.     INLINE $A963;
  658.     {$ENDC}
  659. FUNCTION GetCtlValue(theControl: ControlHandle): INTEGER;
  660.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  661.     INLINE $A960;
  662.     {$ENDC}
  663. PROCEDURE SetCtlMin(theControl: ControlHandle; minValue: INTEGER);
  664.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  665.     INLINE $A964;
  666.     {$ENDC}
  667. FUNCTION GetCtlMin(theControl: ControlHandle): INTEGER;
  668.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  669.     INLINE $A961;
  670.     {$ENDC}
  671. PROCEDURE SetCtlMax(theControl: ControlHandle; maxValue: INTEGER);
  672.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  673.     INLINE $A965;
  674.     {$ENDC}
  675. FUNCTION GetCtlMax(theControl: ControlHandle): INTEGER;
  676.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  677.     INLINE $A962;
  678.     {$ENDC}
  679. PROCEDURE SetCRefCon(theControl: ControlHandle; data: LONGINT);
  680.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  681.     INLINE $A95B;
  682.     {$ENDC}
  683. FUNCTION GetCRefCon(theControl: ControlHandle): LONGINT;
  684.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  685.     INLINE $A95A;
  686.     {$ENDC}
  687. PROCEDURE SetCtlAction(theControl: ControlHandle; actionProc: ControlActionUPP);
  688.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  689.     INLINE $A96B;
  690.     {$ENDC}
  691. FUNCTION GetCtlAction(theControl: ControlHandle): ControlActionUPP;
  692.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  693.     INLINE $A96A;
  694.     {$ENDC}
  695. PROCEDURE SetCtlColor(theControl: ControlHandle; newColorTable: CCTabHandle);
  696.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  697.     INLINE $AA43;
  698.     {$ENDC}
  699. FUNCTION GetCVariant(theControl: ControlHandle): INTEGER;
  700.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  701.     INLINE $A809;
  702.     {$ENDC}
  703. {$ENDC}  {OLDROUTINENAMES}
  704.  
  705.  
  706. {$ALIGN RESET}
  707. {$POP}
  708.  
  709. {$SETC UsingIncludes := ControlsIncludes}
  710.  
  711. {$ENDC} {__CONTROLS__}
  712.  
  713. {$IFC NOT UsingIncludes}
  714.  END.
  715. {$ENDC}
  716.